 <div id="search">
    <form action="search.php" method="POST">
      <p>
      <input type="text" name="txtsearch" id="search_" value="Tên hoặc giá sản phẩm?"   onblur="if(this.value=='') this.value='Tên hoặc giá sản phẩm?';" onfocus="if(this.value=='Tên hoặc giá sản phẩm?') this.value='';"/>
      <input type="hidden" name="search_ad" value="Tìm kiếm"/>
      </p>
    </form>
  </div>
  <table id="sanpham" border=1 style="border-collapse: collapse;border-style: outset;border-width:1px!important ;border-spacing: 2px;">
     
     <tr id="one">
        <td id="id">Id </td>
        <td id="ten">Tên </td>
        <td id="gia">Giá </td>
        <td id="anh">Ảnh </td>
        <td id="phanloai">Phân loại </td>
        <td id="soluong">Số lượng </td>
        <td id="chat">Chất </td>
        <td id="mota">Mô tả </td>
        <td>Ẩn hiện</td>
         <td id="ghichu">Ghí chú </td>
         <td style="width: 40px;">Khuyến mãi</td>
        <td id="option">Tùy chọn </td>
     </tr>
     <?php
      if(isset($_REQUEST[sua]) && $_REQUEST[sua]=yes){
      $id=$_REQUEST[p];
      $mysql->query("select* from sanpham where id='{$id}'");
      $row1=$mysql->fetchRow();
     ?>
     <tr class="suatr">                
          <form action="action.php?p=<?php echo $id;?>" method="post" enctype="multipart/form-data" id="them">
             <td><input class="id_c" type="text" value="<?php echo $row1[id]?>"class="required" /></td>
             <td><input class="sua_c" type="text" name="name" value="<?php echo $row1[name]?>"class="required" /></td>
             <td><input class="sua_g" type="text" name="gia"value="<?php echo $row1[price]?>"class="required" /></td>
             <td><input class="sua_c1" name="file" type="file" class="required" /></td>
             <td><input class="sua_c" type="text" name="category" value="<?php echo $row1[category]?>"class="required" /></td>
             <td><input class="sua_c" type="text" name="number_art"value="<?php echo $row1[number_art]?>"class="required" /></td>
             <td><input class="sua_c" type="text" name="chatlieu"value="<?php echo $row1[chatlieu]?>" class="required"/></td>
             <td><input class="sua_m" type="text" name="mota"value="<?php echo $row1[mota]?>"class="required" /></td>
             <td></td>
             <td><input class="sua_c" type="text" name="ghichu" value="<?php echo $row1[ghichu]?>"class="required" /></td>
             <td></td>
             <td><input type="submit" name="sua" id="sua" value="Edit"/></td>
          </form>
          
     </tr>
      <?php }?>
     <?php
     
        $mysql->query("select * from sanpham ORDER BY id DESC");
         $i=1;
         while($row=$mysql->fetchRow()){
         if($i%2==0){
            $class="chan";
         }else{
            $class="le";
         }
         if($i<=5){
            $new="new";
         }else if($i>5){
            $new="owl";
         }
     ?> 
     
     <tr class="<?php echo $class?>">
        
        <td><?php echo $row[id]?></td>
        <td class="<?php echo $new;?>"><p><?php echo $row[name]?></p></td>
        <td><?php echo $row[price]?></td>
        
        <td class="gallery">
        <a href="../upload/<?php echo $row[img]?>" title="<?php echo$row[mota];?>"> <img  src="../upload/<?php echo $row[img]?>"/></a>
        </td>
        <td><?php echo $row[category]?></td>
        <td><?php echo $row[number_art]?></td>
        <td><?php echo $row[chatlieu]?></td>
        <td><?php echo $row[mota]?></td>
         <td align="center">
             <?php
               if($row[kichhoat]==0){
                echo"<a  class='an' title='Hiện nha' href='action.php?p={$row[id]}&hien=sp1'>Hiện</a>";
               }else if($row[kichhoat]==1){
                echo"<a class='hien' title='Ẩn nha' href='action.php?p={$row[id]}&hien=sp2'>Ẩn</a>";
               }
             ?>
           </td>
        <td><?php echo $row[ghichu]?></td>
      
 
          <td>
          <?php
        if($row[khuyenmai]=='0'){
         echo"<a class='nkm' href='action.php?khuyenmai=true&p={$row[id]}'>nKm</a>";
        }else if($row[khuyenmai]=='1'){
          echo"<a class='km' href='action.php?khuyenmai=flase&p={$row[id]}'>Km</a>";   
        }
        ?>
        </td>
       
        <td class="option_c">
          <script>
            function confirmDelete(delUrl) {
              if (confirm("Are you sure you want to delete")) {
                document.location = delUrl;
              }
            }
            </script>
            
            
           <ul id="tuy_">
              <li><a class="edit"  href="index.php?p=<?php echo $row[id]?>&sua=yes&sanpham=true">Sữa</a></li>
              <li>
              <a class="delete" href="javascript:confirmDelete('action.php?action=delete&p=<?php echo $row[id];?>')">Xóa</a>
              </li>
           </ul>
        </td>
     </tr>
     <?php $i++; }?>
  </table>  
                     